package com.ag.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbGoods entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_GOODS", schema = "dbo", catalog = "AGDB")
public class TbGoods implements java.io.Serializable {

	// Fields

	private String goodsId;
	private TbGoodstype tbGoodstype;
	private TbUnit tbUnit;
	private String goodsName;
	private String goodsDetail;
	private String a;
	private String b;
	private String c;
	private Set<TbTaskResourse> tbTaskResourses = new HashSet<TbTaskResourse>(0);
	private Set<TbAidgoogs> tbAidgoogses = new HashSet<TbAidgoogs>(0);

	// Constructors

	/** default constructor */
	public TbGoods() {
	}

	/** minimal constructor */
	public TbGoods(String goodsId, TbUnit tbUnit, String goodsName) {
		this.goodsId = goodsId;
		this.tbUnit = tbUnit;
		this.goodsName = goodsName;
	}

	/** full constructor */
	public TbGoods(String goodsId, TbGoodstype tbGoodstype, TbUnit tbUnit,
			String goodsName, String goodsDetail, String a, String b, String c,
			Set<TbTaskResourse> tbTaskResourses, Set<TbAidgoogs> tbAidgoogses) {
		this.goodsId = goodsId;
		this.tbGoodstype = tbGoodstype;
		this.tbUnit = tbUnit;
		this.goodsName = goodsName;
		this.goodsDetail = goodsDetail;
		this.a = a;
		this.b = b;
		this.c = c;
		this.tbTaskResourses = tbTaskResourses;
		this.tbAidgoogses = tbAidgoogses;
	}

	// Property accessors
	@Id
	@Column(name = "GOODS_ID", unique = true, nullable = false, length = 14)
	public String getGoodsId() {
		return this.goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "GT_ID")
	public TbGoodstype getTbGoodstype() {
		return this.tbGoodstype;
	}

	public void setTbGoodstype(TbGoodstype tbGoodstype) {
		this.tbGoodstype = tbGoodstype;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UNIT_ID", nullable = false)
	public TbUnit getTbUnit() {
		return this.tbUnit;
	}

	public void setTbUnit(TbUnit tbUnit) {
		this.tbUnit = tbUnit;
	}

	@Column(name = "GOODS_NAME", nullable = false, length = 50)
	public String getGoodsName() {
		return this.goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}

	@Column(name = "GOODS_DETAIL", length = 500)
	public String getGoodsDetail() {
		return this.goodsDetail;
	}

	public void setGoodsDetail(String goodsDetail) {
		this.goodsDetail = goodsDetail;
	}

	@Column(name = "A", length = 50)
	public String getA() {
		return this.a;
	}

	public void setA(String a) {
		this.a = a;
	}

	@Column(name = "B", length = 50)
	public String getB() {
		return this.b;
	}

	public void setB(String b) {
		this.b = b;
	}

	@Column(name = "C", length = 50)
	public String getC() {
		return this.c;
	}

	public void setC(String c) {
		this.c = c;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbGoods")
	public Set<TbTaskResourse> getTbTaskResourses() {
		return this.tbTaskResourses;
	}

	public void setTbTaskResourses(Set<TbTaskResourse> tbTaskResourses) {
		this.tbTaskResourses = tbTaskResourses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tbGoods")
	public Set<TbAidgoogs> getTbAidgoogses() {
		return this.tbAidgoogses;
	}

	public void setTbAidgoogses(Set<TbAidgoogs> tbAidgoogses) {
		this.tbAidgoogses = tbAidgoogses;
	}

}